# 单继承
class Phone:
    id = "20240311"                           # 手机id
    producer = "LI-HOME"                 # 厂商
    def call_by_4G(self):
        print("4G通话已开启")

class Phone2024(Phone):
    face_id = "114511"
    def call_by_5G(self):
        print("5G通话已开启")

# phone = Phone2024()
# print(phone.id)
# print(phone.producer)
# phone.call_by_5G()

# 多继承
class NFCReader:
    nfc_type = "六代"
    producer= "LI"
    def nfc_reader(self):
        print("NFC读卡成功")
    def nfc_writer(self):
        print("NFC写卡成功")

class RemoteControl:
    rc_type = "红外遥控"
    def control(self):
        print("已开启红外遥控")


class MyPhone(Phone,NFCReader,RemoteControl):
    pass                                        # 占位语句，为空
phone = MyPhone()
phone.call_by_4G()
phone.nfc_reader()
phone.nfc_writer()
phone.control()

print(phone.producer)           # 多继承同名方法或属性，先继承的优先级高于后继承
